# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=vncrack
pkgver=1.21
pkgrel=5
pkgdesc='What it looks like: crack VNC.'
arch=('x86_64' 'aarch64')
groups=('blackarch' 'blackarch-cracker')
url='http://194.150.168.69/vncrack/'
license=('GPL')
depends=('glibc')
source=("http://194.150.168.69/$pkgname/${pkgname}_src-$pkgver.tar.gz")
sha512sums=('4e3bbd9bd4c9467b4af56f090695dd20cae55a00ffcf384dd597aacfb3f161625ca07ee23d7113d81543ee3a5d7d6c560189ea214fa47b3abbbab49e90c192b5')

prepare() {
  sed -i "s|#include <d3des.h>|#include <d3des.h>\n#include <time.h>|" \
    libvncauth/vncauth.c
  sed -i "s|#include \"d3des.h\"|#include <d3des.h>\n#include <time.h>|" \
    "$pkgname.c"
  sed -i "s|AR = ar clq|AR = ar cr|" libvncauth/Makefile
}

build() {
  make -C libvncauth clean

  make CC="gcc"
}

package(){
  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
}

